package edu.hunau.cxb19.basic.class02;

/**
 *
 *@author hb
 *
 * 2020-02-10 15:18:44
 */
public class ChangeValueDemo {

	public static void main(String[] args) {
		int a=100;
		int b=200;
		//实现a和b的交换
	    //声明一个临时变量 temp
		int temp;
		temp=a;//将a的值赋给temp
		a=b;//将b的值赋给a
		b=temp;//将temp的值赋给b
		System.out.println(a);
		System.out.println(b);
		System.out.println("a="+a+",b="+b);
		
		//将字符零转成数字零
		char c='0';//'\u0000'
		//ASCII编码中字符零到字符9的编码是连续的
		int c0=c-'0';
		System.out.println(c0);
		
	}
}
